//
//  MenuViewController.m
//  Q8
//
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "MenuViewController.h"
#import "DealersViewController.h"
#import "RentaCompaniesViewController.h"
#import "FinancingViewController.h"
#import "AccessoriesViewController.h"
#import "RepairGarageViewController.h"
#import "WashPlacesViewController.h"
#import "MapsViewController.h"
#import "SaleParchaseViewController.h"
#import "InsuranceViewController.h"

@implementation MenuViewController

// Menu Actionsa

- (IBAction) dealerButtonAction			{

	if (!theDealersView) {
		theDealersView = [[DealersViewController alloc] init];
	}
	
	[self.navigationController pushViewController:theDealersView animated:YES];

  }
- (IBAction) rentalButtonAction			{
	
	if (!theRentalView) {
		theRentalView = [[RentaCompaniesViewController alloc] init];
	}
	
	[self.navigationController pushViewController:theRentalView animated:YES];
	
  }
- (IBAction) financingButtonAction		{
	
	if (!theFinanceView) {
		theFinanceView = [[FinancingViewController alloc] init];
	}
	
	[self.navigationController pushViewController:theFinanceView animated:YES];
	
   }
- (IBAction) salesButtonAction			{
	
	if (!theSalesPurchaseView) {
		theSalesPurchaseView = [[SaleParchaseViewController alloc] init];
	}
	
	[self.navigationController pushViewController:theSalesPurchaseView animated:YES];

  }
- (IBAction) insuranceButtonAction		{

	if (!theInsuranceView) {
		theInsuranceView = [[InsuranceViewController alloc] init];
	}
	
	[self.navigationController pushViewController:theInsuranceView animated:YES];
	
  }
- (IBAction) repairButtonAction			{
	
	if (!theReapreView) {
		theReapreView = [[RepairGarageViewController alloc] init];
	}
	
	[self.navigationController pushViewController:theReapreView animated:YES];
	
  }
- (IBAction) accessoriesButtonAction	{
	
	if (!theAccessoriesView) {
		theAccessoriesView = [[AccessoriesViewController alloc] init];
	}
	
	[self.navigationController pushViewController:theAccessoriesView animated:YES];

   }
- (IBAction) washPlacesButtonAction		{
	
	if (!theWashPlacesView) {
		theWashPlacesView = [[WashPlacesViewController alloc] init];
	}
	
	[self.navigationController pushViewController:theWashPlacesView animated:YES];
	
 }
- (IBAction) mapsButtonAction			{
	
	if (!theMapsView) {
		theMapsView = [[MapsViewController alloc] init];
	}
	
	[self.navigationController pushViewController:theMapsView animated:YES];
}


// Delegate Methods (View Controller)

- (void) viewDidLoad					{
    [super viewDidLoad];
	self.title=@"Q8 Cars";
	
	[theScroll setDelegate:self];
	[theScroll setContentSize:CGSizeMake(0, theScroll.frame.size.height + 30)];
	
}
- (void) didReceiveMemoryWarning		{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}
- (void) viewDidUnload					{	
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}
- (void) dealloc						{
    [super dealloc];
}


@end
